package com.qf.android.huihui.view.activity;

import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.qf.android.huihui.R;
import com.qf.android.huihui.view.activity.common.BaseActivity;

public class WebviewActivity extends BaseActivity {
   private WebView webView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_webview);
        initWindow();
        webView= (WebView) findViewById(R.id.activity_sec_webview);
        webView.setWebViewClient(new WebViewClient());
        String url = getIntent().getStringExtra("url");
        WebSettings settings=webView.getSettings();
        settings.setTextSize(WebSettings.TextSize.SMALLEST);
//        settings.setTextSize(WebSettings.TextSize.SMALLER);
//        settings.setTextSize(WebSettings.TextSize.NORMAL);
//        settings.setTextSize(WebSettings.TextSize.LARGER);
//        settings.setTextSize(WebSettings.TextSize.LARGEST);
        webView.loadUrl(url);

    }

    public void click(View view) {
        switch (view.getId()){
            case R.id.click_back:
                this.finish();
                break;
        }
    }

    private void initWindow() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        }
    }
}
